function getContents(type: string){
    let contents;
    if (typeof window !== 'undefined') {
        switch (type) {
            case 'vue-content-extractor':
                contents = window.__VUE_CONTENTS__
                break
            case 'data-content-extractor':
                contents = window.__DATA_CONTENTS__
                break
            default:
                contents = window.__VUE_CONTENTS__
        }
    }
    return contents;
}


export const loadProdVueFile = async (filePath: string,type:string) => {
    const cachedContents: Record<string, string> | null = getContents(type);
    const normalizedPath = filePath.startsWith('@/')
        ? filePath.replace('@/', 'src/')
        : filePath
    return cachedContents?.[normalizedPath] || null
}

